Skip to content

fix(opencode): include skill files when invoking via slash command - #35522

Closed
0xSkybreaker wants to merge 1 commit into
anomalyco:devfrom
0xSkybreaker:fix/skill-command-files
Closed

fix(opencode): include skill files when invoking via slash command#35522
0xSkybreaker wants to merge 1 commit into
anomalyco:devfrom
0xSkybreaker:fix/skill-command-files

Conversation

@0xSkybreaker

Copy link
Copy Markdown

Issue for this PR

Closes #24831

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

/skill-name only injected the skill markdown body as prompt text, without the <skill_files> section that the skill tool provides. This meant referenced files (e.g. scripts, reference docs) were not discoverable by the model when using the slash command shortcut.

The fix makes the skill command template include sampled files (up to 10) from the skill directory, matching the behavior of the skill tool (tool/skill.ts).

The change is in command/index.ts: for skills with a real location, the template now uses Glob.scan to list files and appends a <skill_files> section, same format as the skill tool output.

How did you verify your code works?

  • Verified TypeScript compiles cleanly in packages/opencode
  • The output format matches the existing <skill_files> format from tool/skill.ts
  • Built-in skills (with <built-in> location) are unchanged — they still return just the content

Screenshots / recordings

No UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@SakshamKapoor2911

Copy link
Copy Markdown

Hi, I submitted #37044 which addresses the same issue with a slightly different approach — using \Glob.scanSync()\ (synchronous) instead of \Glob.scan().then()\ to keep the template getter simple, and */\ to include subdirectory files.

Both approaches are valid. Happy to close mine if you prefer to continue with this one — just wanted to avoid duplicate work. Either way, this bug definitely needs fixing!

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/skill-name doesn’t invoke full skill system

2 participants